home *** CD-ROM | disk | FTP | other *** search
/ 3D Games - Real-time Rend…ng & Software Technology / 3D Games - Real-time Rendering & Software Technology.iso / flysdk / plugin / car / car.h < prev   
Encoding:
C/C++ Source or Header  |  2000-03-27  |  2.2 KB  |  125 lines

  1. #define FLYMP_MSG_POS 9180
  2.  
  3. class camera;
  4. class car;
  5. class sun;
  6.  
  7. struct mp_data
  8. {
  9.     DWORD type,dpid,flag;
  10.     float wheelrot;
  11.     vector pos,vel,Y,Z;
  12. };
  13.  
  14. enum classes_types
  15. {
  16.     TYPE_CAR=0x400,
  17.     TYPE_CAMERA,
  18.     TYPE_SUN
  19. };
  20.  
  21. class car : public bsp_object
  22. {
  23. public:
  24.     car() 
  25.     { 
  26.         type=TYPE_CAR; player=0;
  27.         wheelrot=0; wheelroll=0; 
  28.         contactobj=0; contactfacenum=0;
  29.         totaltracktime=curtracktime=0;
  30.     }
  31.  
  32.     float accel;
  33.     float maxvel;
  34.     vector veldamp;
  35.     float carwheelrot;
  36.     float carheight;
  37.     float wheelrotvel;
  38.     float wheelmaxrot;
  39.     float wheelrotdamp;
  40.     float wheelradius;
  41.     float gravity;
  42.     mesh *carmesh;
  43.     mesh *wheelmesh;
  44.     vector wheelposft;
  45.     vector wheelposbk;
  46.     bezier_curve *track;
  47.     shadow *carshadow;
  48.  
  49.     int totaltracktime,curtracktime,player;
  50.     float wheelrot,wheelroll;
  51.     mesh *contactobj;
  52.     int contactfacenum;
  53.  
  54.     void check_keys(int dt);
  55.     void check_robot_keys(int dt);
  56.     void mp_send_pos(int msgtype,int msgflag);
  57.     void draw_stencil_shadow(vector& lightpos);
  58.  
  59.     void init();
  60.     int step(int dt);
  61.     void draw();
  62.     int get_custom_param_desc(int i,param_desc *pd);
  63.     bsp_object *clone();
  64.     mesh *get_mesh() { return carmesh; };
  65. };
  66.  
  67. class camera : public bsp_object
  68. {
  69. public:
  70.     camera() { type=TYPE_CAMERA; };
  71.  
  72.     float height;
  73.     float dist;
  74.     float maxvel;
  75.     vector lp;
  76.     bsp_object *target;
  77.     sun *s;
  78.  
  79.     void init();
  80.     int step(int dt);
  81.     int get_custom_param_desc(int i,param_desc *pd);
  82.     bsp_object *clone();
  83. };
  84.  
  85. class sun : public bsp_object
  86. {
  87. public:
  88.     sun() { type=TYPE_SUN; };
  89.  
  90.     mesh *objmesh;
  91.     vector color;
  92.     int halopic;
  93.     float halosize;
  94.  
  95.     void init();
  96.     void draw();
  97.     int get_custom_param_desc(int i,param_desc *pd);
  98.     bsp_object *clone();
  99. };
  100.  
  101. class car_desc : public class_desc
  102. {
  103. public:
  104.     void *create() { return new car; };
  105.     char *get_name() { return "car"; };
  106.     int get_type() { return TYPE_CAR; };
  107. };
  108.  
  109. class camera_desc : public class_desc
  110. {
  111. public:
  112.     void *create() { return new camera; };
  113.     char *get_name() { return "camera"; };
  114.     int get_type() { return TYPE_CAMERA; };
  115. };
  116.  
  117. class sun_desc : public class_desc
  118. {
  119. public:
  120.     void *create() { return new sun; };
  121.     char *get_name() { return "sun"; };
  122.     int get_type() { return TYPE_SUN; };
  123. };
  124.  
  125.